﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace theguineasyndrome
{
    public class Clouds
    {
        private Level level;
        private Texture2D cloudTexture;
        private List<Cloud> clouds;

        public Clouds(Level level, Texture2D cloudTexture)
        {
            this.level = level;
            this.cloudTexture = cloudTexture;
            clouds = new List<Cloud>();
        }

        public void add(Vector2 position)
        {
            clouds.Add(new Cloud(level, cloudTexture, position));
        }

        public void Update(GameTime gameTime)
        {
            for (int i = clouds.Count - 1; i >= 0; i--)
            {
                Cloud cloud = clouds[i];
                cloud.Update(gameTime);
                if (cloud.Dead)
                    clouds.RemoveAt(i);
            }
        }

        public void queueDrawing(Camera camera)
        {
            foreach (Cloud cloud in clouds)
                cloud.queueDrawing(camera);
        }
    }
}
